var paperCard = {
    uploadCardImg: function (preFileId, relationId, moduleCode) {
        confirm("上传新的图片会自动删除旧的图片，是否继续？", function () {
            JWB.http.uploadImgPage(relationId, moduleCode, function (res) {

                if (res.code == 0) {
                    alert(res.msg);
                    if (preFileId != null && preFileId != "") {
                        var url = base.basePath + "sysfile/delete";
                        var data = {
                            "sysFile.fileId": preFileId
                        };
                        $.ajax({
                            url: url,
                            data: data,
                            success: function (res) {
                                if (res.code != 0) {
                                    alert("删除旧的图片失败，为了避免出问题，请联系技术人员");
                                } else {
                                    index_js.reloadRightPage();
                                }
                            },
                            error: function (jXHR, textStatus, errorThrown) {
                                JWB.http.errorHandle(jXHR, textStatus, errorThrown)
                            }
                        });
                    } else {
                        index_js.reloadRightPage();
                    }
                }
                $("#uploadFloatageWindow").remove();
            });
        });
    }
    ,
    editPage: function (paperCardId) {
        var url = base.basePath + "page/paperCard/editPaperCard.cgi";
        if (paperCardId != null) {
            url += ("?paperCardId=" + paperCardId);
        }
        index_js.appendHtmlByUrl(url);
    },

};